const express = require('express')
var multerUpload = require('../utils/multerfs')
const {getGoodsList,addGoods,delteGoodsById,getGoodsById,addOrder,
editGoods,batchDeleteGoodsById,getGoodsByClassifyid,getOrderList,getOrderById,editOrder,
delteOrdersById,getAllOrderById,getConfirmOrder,addSalesVolume,getAllList} = require('../controller/goodsController')
const router = express.Router()

router.post('/add',multerUpload.single('myfile'), addGoods)
router.post('/edit',multerUpload.single('myfile'), editGoods)
router.post('/delete', delteGoodsById)
router.post('/batchdelete', batchDeleteGoodsById)
router.get('/list', getGoodsList)
router.get('/alllist', getAllList)
router.get('/detail', getGoodsById)
router.get('/category', getGoodsByClassifyid)
router.post('/order', addOrder)
router.get('/orderlist', getOrderList)
router.get('/allorder', getAllOrderById)
router.get('/orderdetail', getOrderById)
router.post('/editorder', editOrder)
router.post('/deleteorder', delteOrdersById)
router.post('/confirmorder', getConfirmOrder)
router.post('/edit_sales_volume', addSalesVolume)
// router.get('/:id', getGoodsById)
// router.delete('/:id', delteGoodsById)

module.exports = router
